package ASSET.RESOURCE;

import java.net.InetAddress;
import java.net.UnknownHostException;

import javax.swing.JFrame;

import TOOLS.SQLtool;
import TOOLS.errCodeManagement;

public class test002_resourceMana {

	public static void main(String[] args) {
		SQLtool sql=new SQLtool();
		JFrame jf=new JFrame();
		String IPaddr="192.168.1.1";
		try {
			InetAddress addr = InetAddress.getLocalHost();
			IPaddr=addr.getHostAddress();
		} catch (UnknownHostException e1) {
			;
		}
		sql.config(IPaddr, "AKS2019", "sa", "123456");
//		sql.config("10.130.0.231", "Smes", "sa", "led-00");
//		if(IPaddr.startsWith("192.168")) {
//			sql.config("192.168.0.39", "AKS2019", "sa", "abcd1234!");
//		}else {
//			sql.config("10.130.1.19", "AKS2019", "sa", "abcd1234!");
//		}
		sql.config(IPaddr, "AKS2019", "sa", "123456");
		try {
			sql.connect();
			jf.setVisible(true);
			resourceManagement c=new resourceManagement(sql);
			c.management();
//			c_resource cr=new c_resource(sql);
//			cr.newDBsheet();
//			cr.newDBview();
			System.exit(0);
		} catch (Exception e) {
			String str=errCodeManagement.getErrText(e.getMessage());
			System.out.println(str);
			System.exit(0);
		}
	}

}
